.TH "src/datastore.h" 3 "Fri Apr 15 2016" "Version 0.10.0-146_trunk" "libnetconf" \" -*- nroff -*-
.ad l
.nh
.SH NAME
src/datastore.h \- 
.PP
NETCONF datastore handling function prototypes and structures\&.  

.SH SYNOPSIS
.br
.PP
\fC#include 'netconf\&.h'\fP
.br
\fC#include 'error\&.h'\fP
.br

.SS "Macros"

.in +1c
.ti -1c
.RI "#define \fBNCDS_INTERNAL_ID\fP   0"
.br
.RI "\fIDatastore ID to access libnetconf's internal datastores such as notifications, monitoring, etc\&. \fP"
.ti -1c
.RI "#define \fBNCDS_RPC_NOT_APPLICABLE\fP   ((void*)(&\fBerror_area\fP))"
.br
.RI "\fIReturn value of \fBncds_apply_rpc2all()\fP when the requested operation is not applicable to the datastore\&. \fP"
.in -1c
.SS "Typedefs"

.in +1c
.ti -1c
.RI "typedef int \fBncds_id\fP"
.br
.RI "\fIDatastore ID\&. \fP"
.in -1c
.SS "Enumerations"

.in +1c
.ti -1c
.RI "enum \fBNCDS_TYPE\fP { \fBNCDS_TYPE_ERROR\fP = -1, \fBNCDS_TYPE_EMPTY\fP, \fBNCDS_TYPE_FILE\fP, \fBNCDS_TYPE_CUSTOM\fP }"
.br
.RI "\fIDatastore implementation types provided by libnetconf\&. \fP"
.in -1c
.SS "Functions"

.in +1c
.ti -1c
.RI "int \fBncds_add_augment_transapi\fP (const char *model_path, const char *callbacks_path)"
.br
.RI "\fIExtend datastore(s) with an augment model and its transAPI callbacks\&. \fP"
.ti -1c
.RI "int \fBncds_add_model\fP (const char *path)"
.br
.RI "\fIAdd an configuration data model to the internal list of models\&. Such model is used to resolve imports, includes and uses statements in base models\&. \fP"
.ti -1c
.RI "int \fBncds_add_models_path\fP (const char *path)"
.br
.RI "\fISpecify a directory path to the location where the required (imported or included) data models can be found\&. This function can be called repeatedly to specify multiple locations\&. \fP"
.ti -1c
.RI "\fBnc_reply\fP * \fBncds_apply_rpc2all\fP (struct nc_session *session, const \fBnc_rpc\fP *rpc, \fBncds_id\fP *ids[])"
.br
.RI "\fIPerform the requested RPC operation on the all datastores controlled by the libnetconf (created by ncdsd_new() and \fBncds_init()\fP)\&. \fP"
.ti -1c
.RI "void \fBncds_break_locks\fP (const struct nc_session *session)"
.br
.RI "\fIRemove all the locks that the given session is holding\&. \fP"
.ti -1c
.RI "int \fBncds_consolidate\fP (void)"
.br
.RI "\fIConsolidate all internal structures of created data stores and all data models\&. This function especially solves all YANG's \fCuses\fP and \fCaugment\fP statements\&. \fP"
.ti -1c
.RI "int \fBncds_device_init\fP (\fBncds_id\fP *id, struct nc_cpblts *cpblts, int force)"
.br
.RI "\fIInitialize transAPI module(s) (if present) and copy startup configuration to running\&. \fP"
.ti -1c
.RI "int \fBncds_feature_disable\fP (const char *module, const char *feature)"
.br
.RI "\fIDisable usage of the specified feature defined in the specified module By default, all features are disabled\&. \fP"
.ti -1c
.RI "int \fBncds_feature_enable\fP (const char *module, const char *feature)"
.br
.RI "\fIEnable usage of the specified feature defined in the specified module\&. By default, all features are disabled\&. \fP"
.ti -1c
.RI "int \fBncds_feature_isenabled\fP (const char *module, const char *feature)"
.br
.RI "\fICheck if the feature of the specified module is currently enabled or disabled\&. \fP"
.ti -1c
.RI "int \fBncds_features_disableall\fP (const char *module)"
.br
.RI "\fIDisable usage of all features defined in the specified module\&. By default, all features are disabled\&. To disable only the specific feature(s), use \fBncds_feature_disable()\fP\&. \fP"
.ti -1c
.RI "int \fBncds_features_enableall\fP (const char *module)"
.br
.RI "\fIEnable usage of all features defined in the specified module\&. By default, all features are disabled\&. To enable only the specific feature(s), use \fBncds_feature_enable()\fP\&. \fP"
.ti -1c
.RI "int \fBncds_file_set_path\fP (struct ncds_ds *datastore, const char *path)"
.br
.RI "\fIAssign the path of the datastore file into the datastore structure\&. \fP"
.ti -1c
.RI "void \fBncds_free\fP (struct ncds_ds *datastore)"
.br
.RI "\fIClose the specified datastore and free all the resources\&. \fP"
.ti -1c
.RI "void \fBncds_free2\fP (\fBncds_id\fP datastore_id)"
.br
.RI "\fIClose specified datastore and free all the resources\&. \fP"
.ti -1c
.RI "char * \fBncds_get_model\fP (\fBncds_id\fP id, int base)"
.br
.RI "\fIReturn a serialized XML containing the data model in the YIN format\&. \fP"
.ti -1c
.RI "const char * \fBncds_get_model_path\fP (\fBncds_id\fP id)"
.br
.RI "\fIReturn path to the file containing the datastore datamodel\&. \fP"
.ti -1c
.RI "\fBncds_id\fP \fBncds_init\fP (struct ncds_ds *datastore)"
.br
.RI "\fIActivate datastore structure for use\&. \fP"
.ti -1c
.RI "int \fBncds_model_info\fP (const char *path, char **name, char **version, char **ns, char **prefix, char ***rpcs, char ***notifs)"
.br
.RI "\fIInformational function to get basic information about configuration data model in the given file\&. \fP"
.ti -1c
.RI "struct ncds_ds * \fBncds_new\fP (\fBNCDS_TYPE\fP type, const char *model_path, char *(*get_state)(const char *model, const char *running, struct nc_err **e))"
.br
.RI "\fICreate a new datastore structure of the specified implementation type\&. \fP"
.ti -1c
.RI "struct ncds_ds * \fBncds_new_transapi\fP (\fBNCDS_TYPE\fP type, const char *model_path, const char *callbacks_path)"
.br
.RI "\fICreate new datastore structure with transaction API support\&. \fP"
.ti -1c
.RI "int \fBncds_rollback\fP (\fBncds_id\fP id)"
.br
.RI "\fIUndo the last change performed on the specified datastore\&. \fP"
.ti -1c
.RI "int \fBncds_set_validation\fP (struct ncds_ds *ds, int enable, const char *relaxng, const char *schematron)"
.br
.RI "\fISet validators (or disable validation) on the specified datastore\&. \fP"
.in -1c
.SS "Variables"

.in +1c
.ti -1c
.RI "char \fBerror_area\fP"
.br
.in -1c
.SH "Detailed Description"
.PP 
NETCONF datastore handling function prototypes and structures\&. 


.PP
\fBAuthor:\fP
.RS 4
Radek Krejci rkrejci@cesnet.cz Copyright (c) 2012-2014 CESNET, z\&.s\&.p\&.o\&.
.RE
.PP
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
.IP "1." 4
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer\&.
.IP "2." 4
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution\&.
.IP "3." 4
Neither the name of the Company nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission\&.
.PP
.PP
ALTERNATIVELY, provided that this notice is retained in full, this product may be distributed under the terms of the GNU General Public License (GPL) version 2 or later, in which case the provisions of the GPL apply INSTEAD OF those given above\&.
.PP
This software is provided ``as is, and any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed\&. In no event shall the company or contributors be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage\&. 
.SH "Function Documentation"
.PP 
.SS "int ncds_device_init (\fBncds_id\fP *id, struct nc_cpblts *cpblts, intforce)"

.PP
Initialize transAPI module(s) (if present) and copy startup configuration to running\&. 
.PP
\fBParameters:\fP
.RS 4
\fIid\fP Pointer to ncds_id of device to initialize, if NULL all found transapi-capable devices will be initialized 
.br
\fIcpblts\fP Server's NETCONF capabilities\&. If NULL, default capabilities from libnetconf are used\&. 
.br
\fIforce\fP Force fresh configuration of device from STARTUP datastore\&.
.RE
.PP
\fBReturns:\fP
.RS 4
EXIT_SUCCESS or EXIT_FAILURE 
.RE
.PP

.SH "Variable Documentation"
.PP 
.SS "char error_area"

.SH "Author"
.PP 
Generated automatically by Doxygen for libnetconf from the source code\&.
